package com.h3c.nem.task;

import com.h3c.nem.service.ITbTeacherService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Author: yys44482
 * @Date: 2022/8/1
 * 每季度第一天从allWorker表查现在不是导师的人中的三四级部门的员工中满足初次认证导师资格条件的员工，导师邮件推送给主管，让主管在菜单里发起认证申请
 */
@Slf4j
@JobHandler(value = "AutoInfoLeaderToCertificateHandler")
@Component
@AllArgsConstructor
public class AutoInfoLeaderToCertificateHandler extends IJobHandler {

    private ITbTeacherService tbTeacherService;

    @Override
    public ReturnT<String> execute(String s) throws Exception {
        XxlJobLogger.log("XXL-JOB, AutoInfoLeaderToCertificateHandler");
        XxlJobLogger.log("准备开始调用方法");
        tbTeacherService.autoInfoLeaderToCertificate();
        XxlJobLogger.log("调用结束");
        return SUCCESS;
    }
}
